<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>角色编辑</title>
    <script src="../../js/jquery.js"></script>
    <script src="../../layui/layui.js"></script>
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <script src="../../js/myAjax.js"></script>
    <script src="../../js/utlis/add.js"></script>
</head>
<body>
<div style="margin-left: 80px; margin-top: 50px">
    <div type="hidden" id="roleId"></div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色名</label>
        <div class="layui-input-inline">
            <input type="text" name="title"  required lay-verify="required" id="roleName" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色说明</label>
        <div class="layui-input-inline">
            <input type="text" name="title"  required lay-verify="required" id="description" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否可用</label>
        <div class="layui-input-inline">
            <input type="text" name="title" required lay-verify="required" id="status" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">创建时间</label>
        <div class="layui-input-inline">
            <input type="text" name="title"  required lay-verify="required" id="createTime" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" onclick="add('/role/add',getData())">确认添加</button>
            <button type="reset" onclick="resetAdd('/html/permission/roleAdd.html')" class="layui-btn layui-btn-primary">
                点击重置
            </button>
        </div>
    </div>
</div>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#createTime' //指定元素
            ,type: 'datetime'
            ,format: 'yyyy-MM-dd HH:mm:ss'
        });
    });
    function getData() {
        let data = {
            roleName: $("#roleName").val(),
            description: $("#description").val(),
            status: $("#status").val(),
            createTime: $("#createTime").val(),
        }
        return data;
    }
</script>
</body>
</html>